﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace ArgusPCLib.Mathematics
{
	class OperatorTemplate : IOperator
	{
		#region IOperator
		public static OperatorTemplate GetInstance() { return new OperatorTemplate(); }

		OperatorTemplate()
		{ }

		public string Symbol { get { return "+"; } }
		public string GetSymbol(CultureInfo ci) { return this.Symbol; }
		public int RequiredOperands { get { return 2; } }
		public int Precedence { get { return 100; } }

		public Type[][] GetSupportedParameterTypes()
		{
			return new Type[][]
			{
				new Type[]{typeof(IScalar), typeof(IScalar)}
			};
		}

		public IOperand ApplyOperator(IOperand[] operands)
		{
			return ((IScalar)operands[0]).Add((IScalar)operands[1]);
		}
		#endregion
	}
}
